/*
  解构
*/
//数组的解构常用写法 根据位置提取
let arr = [1, 2, 3];
const [foo, bar, baz, more = "666"] = arr;
const [, , bat] = arr;
const [fo, ...res] = arr;

//对象的解构常用写法 根据属性名提取
const obj = { name: "caozy", age: 18 };
let { name } = obj;
let { color = "blue" } = obj;
const name = "foo";
let { name: objName = "jeck" } = obj; //解决命名冲突
